#include <iostream>
#include <string>
#include <cctype>
using namespace std;

int main()
{
    string a;
    getline(cin, a);
    int counts[4] = {0};
    for (auto ch : a)
    {
        if (isdigit(ch))
        {
            counts[2]++;
        }
        else if (isalpha(ch))
        {
            counts[0]++;
        }
        else if (ch == ' ')
        {
            counts[1]++;
        }
        else
        {
            counts[3]++;
        }
    }
    for (auto a :counts)
    {
        cout << a << endl;
    }
    return 0;
}
